/*
 * Copyright (c) 2011 Team A CS2340. All rights reserved.
 */

package edu.gatech.teama.doctorsoffice.model;

import java.io.IOException;
import java.io.Serializable;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;


/**
 * The Class Nurse creates a nurse user
 * 
 * @author TeamA
 * @version 1.0
 */
public class Nurse extends User implements Serializable{

	/** The logger. */
	private static final Logger MYLOGGER = 
		Logger.getLogger("edu.gatech.teama.doctorsoffice.model.Nurse");

	static {
		FileHandler fh = null;
		try {
			fh = new FileHandler("application.log");
		} catch (SecurityException e) {
			MYLOGGER.log(Level.SEVERE, 
					"Security Exception creating the logger file handler");
			e.printStackTrace();
		} catch (IOException e) {
			MYLOGGER.log(Level.SEVERE, "IO Exception creating the logger file handler");
			e.printStackTrace();
		}

		MYLOGGER.addHandler(fh);
		MYLOGGER.setLevel(Level.ALL);
	}

	/**
	 * Instantiates a new nurse.
	 *
	 * @param username the username
	 */
	public Nurse(String username){
		super(username);
		MYLOGGER.log(Level.INFO, "Nurse: " + username);
	}

	/**
	 * Instantiates a new Nurse.
	 *
	 * @param username the username
	 * @param firstName the first name
	 * @param lastName the last name
	 * @param phoneNumber the phone number
	 * @param address the address
	 * @param emailAddress the email address
	 */
	public Nurse(String username, String firstName, String lastName, String phoneNumber,
			Address address, String emailAddress){
		super(username, firstName, lastName, phoneNumber, address, emailAddress);

		MYLOGGER.log(Level.INFO, "New Nurse: " + username + ", " + firstName
				+ " " + lastName + ", " + phoneNumber + ", "
				+ address + ", " + emailAddress);     
	}

	/**
	 * Returns nurse firstname and lastname.
	 * 
	 * @return First and last name of nurse
	 */
	@Override
	public String toString() {
		return "Nurse:" + getFirstName() + " "
				+ getLastName();
	}
	
	//TODO maybe make nurse in charge of appointments

}

